icon

Usetutoringspotscode to get 8% OFF on your first order!

Computer Science Assignment

TURING IS THE LANGUAGE

Write a program that performs various transformations on the values within an array ofÂ

Â

integers. Â The maximum size of the array is 20. Allow the user to enter the start andÂ

Â

ending of the array. Â Your program should be menu-driven so that a user can select aÂ

Â

transformation to apply to the array similar to the one below. Â In addition, you are toÂ

Â

design one new transformation and add them to the existing menu and provide aÂ

Â

description of its functionality in your internal documentation.

Â

Please select an option:Â

Â

0 – exitÂ

Â

1 – initializeÂ

Â

2 – square

Â

3 – halve

Â

4 – accumulate

Â

5 – transpose

Â

6 – shiftÂ

Â

7 – reverseÂ

Â

8 – under construction

Â

Suppose the array starts at 1 and ends at 20 then:

Â

Input: Â 1

Â

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Â

Input: 2

Â

Output: 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400

Â

Input: 1

Â

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Â

Input: 3

Â

Output: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10

Â

Input: 4

Â

Output: 0 1 3 5 8 11 15 19 24 29 35 41 48 55 63 71 80 89 99 109

Â

Input: Â 1

Â

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Â

Input: 5

Â

Output: 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19

Â

Input: 6

Â

Output: 19 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20Â

Â

Input: 7

Â

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Computer Science Assignment

TURING IS THE LANGUAGE

Write a program that performs various transformations on the values within an array ofÂ

Â

integers. Â The maximum size of the array is 20. Allow the user to enter the start andÂ

Â

ending of the array. Â Your program should be menu-driven so that a user can select aÂ

Â

transformation to apply to the array similar to the one below. Â In addition, you are toÂ

Â

design one new transformation and add them to the existing menu and provide aÂ

Â

description of its functionality in your internal documentation.

Â

Please select an option:Â

Â

0 – exitÂ

Â

1 – initializeÂ

Â

2 – square

Â

3 – halve

Â

4 – accumulate

Â

5 – transpose

Â

6 – shiftÂ

Â

7 – reverseÂ

Â

8 – under construction

Â

Suppose the array starts at 1 and ends at 20 then:

Â

Input: Â 1

Â

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Â

Input: 2

Â

Output: 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400

Â

Input: 1

Â

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Â

Input: 3

Â

Output: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10

Â

Input: 4

Â

Output: 0 1 3 5 8 11 15 19 24 29 35 41 48 55 63 71 80 89 99 109

Â

Input: Â 1

Â

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Â

Input: 5

Â

Output: 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19

Â

Input: 6

Â

Output: 19 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20Â

Â

Input: 7

Â

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes